package ecom.appcode.business;

import java.util.List;

import ecom.appcode.common.daobean.ShoesDaoBean;
import ecom.appcode.dao.daointerface.ShoesDao;
import ecom.appcode.dao.daointerface.ShoesDaoImpl;

public class ShoesLogicImpl implements ShoesLogic {

    /** Load new Arrivals Item */
    public List<ShoesDaoBean> loadNewArrivalsItems(String date, int index) {
        ShoesDao shoesImpl = new ShoesDaoImpl();
        List<ShoesDaoBean> shoesList = shoesImpl.loadNewArrivalsItems(date, index);
        return shoesList;
    }

    /** Load a shoes */
    public ShoesDaoBean loadAShoesProduct(int shoesID) {
        ShoesDao shoesImpl = new ShoesDaoImpl();
        ShoesDaoBean shoesBean = shoesImpl.loadAShoesProduct(shoesID);
        return shoesBean;
    }

    /** Load Product by categoryID AND SEX */
    public List<ShoesDaoBean> loadShoesbyCategoryIDAndSex(int categoryID, String sex) {
        ShoesDao shoesImpl = new ShoesDaoImpl();
        List<ShoesDaoBean> shoesList = shoesImpl.loadShoesbyCategoryIDAndSex(categoryID, sex);
        return shoesList;
    }

    /** Load Product by categoryID */
    public List<ShoesDaoBean> loadShoesbyCategoryID(int categoryID) {
        ShoesDao shoesImpl = new ShoesDaoImpl();
        List<ShoesDaoBean> shoesList = shoesImpl.loadShoesbyCategoryID(categoryID);
        return shoesList;
    }

    /** Load TOP 20 Sales Shoes */
    public List<ShoesDaoBean> loadTop20SaleShoes() {
        ShoesDao shoesImpl = new ShoesDaoImpl();
        List<ShoesDaoBean> shoesList = shoesImpl.loadTop20SaleShoes();
        return shoesList;
    }

    /** Search shoes by name and Color */
    public List<ShoesDaoBean> searchShoes(String name, String color) {
        ShoesDao shoesImpl = new ShoesDaoImpl();
        List<ShoesDaoBean> shoesList = shoesImpl.searchShoes(name, color);
        return shoesList;
    }

    /** Load color on combo box */
    public List<ShoesDaoBean> loadColor() {
        ShoesDao shoesImpl = new ShoesDaoImpl();
        List<ShoesDaoBean> shoesList = shoesImpl.loadColor();
        return shoesList;
    }

    /** Load All Sale Items */
    public List<ShoesDaoBean> loadAllSaleItems() {
        ShoesDao shoesImpl = new ShoesDaoImpl();
        List<ShoesDaoBean> shoesList = shoesImpl.loadAllSaleItems();
        return shoesList;
    }

    /** Select all Shoes for admin page */
    public List<ShoesDaoBean> loadAllShoes() {
        ShoesDao shoesImpl = new ShoesDaoImpl();
        List<ShoesDaoBean> shoesList = shoesImpl.loadAllShoes();
        return shoesList;
    }

    /** Add new shoes */
    public boolean addNewShoes(String name, String color, float unitPrice, int quantity, String urlImage,
            int categoryID, String sex, String dateCarry, float discount, String description, String brand) {
        ShoesDao shoesImpl = new ShoesDaoImpl();
        boolean result = shoesImpl.addNewShoes(name, color, unitPrice, quantity, urlImage, categoryID, sex, dateCarry,
                discount, description, brand);
        return result;
    }

    /** Update Shoes */
    public boolean updateShoes(int shoesID, String name, String color, float unitPrice, int quantity, String urlImage,
            int categoryID, String sex, String dateCarry, float discount, String description, String brand) {
        ShoesDao shoesImpl = new ShoesDaoImpl();
        boolean result = shoesImpl.updateShoes(shoesID, name, color, unitPrice, quantity, urlImage, categoryID, sex,
                dateCarry, discount, description, brand);
        return result;
    }
    
    /** Delete Shoes */
    public boolean deleteShoes(int shoesID) {
        ShoesDao shoesImpl = new ShoesDaoImpl();
        boolean result = shoesImpl.deleteShoes(shoesID);
        return result;
    }
    
    /** Load Shoes New Arrivals */
    public List<ShoesDaoBean> loadShoesNewArrivals(int categoryID, String date) {
        ShoesDao shoesImpl = new ShoesDaoImpl();
        List<ShoesDaoBean> shoesList = shoesImpl.loadShoesNewArrivals(categoryID, date);
        return shoesList;
    }

}
